package file_homework;

import java.io.File;

public class ListFiles3 {
    public static void main(String[] args) {
       File dir =new File(".");
       if (dir.isDirectory()){
           File[]sub = dir.listFiles(file -> file.getName().endsWith(".txt"));
           for (File subs:sub) {
               System.out.println(subs.getName());
           }
       }

    }
}
